import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    token: localStorage.getItem('cms-token'),
    username: localStorage.getItem('username')
  },
  mutations: {
    setToken(state, payload) {
      state.token = payload
      localStorage.setItem("cms-token", payload);


    },
    setUsername(state, payload) {
      state.username = payload
      localStorage.setItem("username", payload);
    }
  },
  actions: {
  },
  modules: {
  },


})


